#pragma once

#include <Runtime/Core/Core.h>
#include <Runtime/Graphics/Device/GraphicsDeviceObject.h>
#include "TextureViewDesc.h"


class TextureView : public GraphicsDeviceObject {
public:
	TextureView(std::shared_ptr<GraphicsDevice> device, const TextureViewDesc& desc);
	TextureView(const TextureView&) = delete;
	TextureView& operator=(const TextureView&) = delete;
	virtual ~TextureView() override = default;

	virtual DeviceObjectType GetDeviceType() noexcept override { return DeviceObjectType::TextureView; }
	ComPtr<ID3D11ShaderResourceView>& GetTextureView() { return mTextureView; }
	TextureFormat GetFormat() { return mFormat; }
	ShaderResourceViewDimension GetSRVDimension() { return mSRVDimension; }
	uint32 GetMostDetailedMip() { return mMostDetailedMip; }
	uint32 GetMipLevels() const { return mMipLevels; }

private:
	TextureFormat mFormat;
	ShaderResourceViewDimension mSRVDimension;
	uint32 mMostDetailedMip;
	uint32 mMipLevels;

	ComPtr<ID3D11ShaderResourceView> mTextureView;
	ComPtr<ID3D11Texture2D> mTexture;
};